<?php

namespace App\Http\Requests;
/**
 * 表单验证
 * Class ArticleSaveRequest
 * @package App\Http\Requests
 */
class ArticleSaveRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        $rules = [
            'title'=>['required']
        ];
        $id = $this->get('id', 0);
        if($id){
            //修改
        }else{
            //新增
        }
        return $rules;
    }

    public function messages()
    {
        return [
            'title.required'=>'标题必填'
        ];
    }
}
